<?php

/***********************************************************
 * 
 ***********************************************************/
class TablesController extends rokko\RokkoController {

   /***********************************************************
    * ACTIONS: The meat of the controller!
    * The way this action is accessed is by using its name in the reqName parameter in the HTTP request.
    * I've decided to leave the naming convention open so you can name the controller actions anything you'd like.
    ***********************************************************/
   public function getTablesJSON(){

      $this->loadModel("Table");
      $tables = $this->model["Table"]->getTableNames();
      
      
      //
      // Return some JSON object
      //
      rokko\RokkoMVC::setContentType(rokko\RokkoMIME::JSON);
      echo json_encode(array("tables" => $tables));
      exit;
   }
}
